package com.lujieni.myredis.controller;

import com.lujieni.myredis.cache.PersonCache;
import com.lujieni.myredis.domain.po.Person;
import com.lujieni.myredis.redis.CacheHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Package: com.lujieni.myredis.controller
 * @ClassName: PersonController
 * @Author: lujieni
 * @Description: 1
 * @Date: 2021-02-19 17:24
 * @Version: 1.0
 */
@RestController
public class PersonController {

    @Autowired
    private PersonCache personCache;

    @GetMapping("/person")
    public Person getPerson(){
        Person person = personCache.get("lugege");
        return person;
    }


}